<template>
  <div class="item">
    <p class="title">{{ item.title }}</p>
    <div class="text" v-if="!image">
      <span :style="{ color:item.textColor }" class="text-desc">{{ item.text }}</span>
      <span v-if="!icon" class="iconfont icon-jiantouyou"></span>
    </div>
    <div class="mixin" v-else>
      <img class="mixin-img" :src="item.image" alt="">
      <span class="iconfont icon-jiantouyou"></span>
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref, reactive } from "vue"

interface IItem{
  title:string,
  text?:string,
  image?:string,
  textColor?:string,
}

const props = defineProps<{
  image?: boolean,
  icon?:boolean,
  item:IItem
}>()

</script>
<style lang="less" scoped>
.item {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #f3f4f5;
  border-top: 1px solid #f3f4f5;
  padding: 0 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;

  .title {
    flex: 1;
    font-size: 14px;
    padding-left: 10px;
    text-align: left;
    height: 50px;
    line-height: 50px;
  }

  .text {
    .text-desc {
      font-size: 14px;
      margin-right: 10px;
    }

    .iconfont {
      font-size: 15px;
    }
  }

  .mixin {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;

    img {
      width: 50px;
      height: 50px;
      padding: 10px 0;
      margin-right: 10px;
    }

    .iconfont {
      font-size: 15px;
    }
  }
}
</style>
